import request from "./request";

const $apis = {
  /**
   * 登录
   * @param {string} address 钱包地址
   * @param {string} invite_code 邀请码
   */
  login: (address, invite_code) =>
    request.post("/api/common/user_login", {
      address,
      invite_code,
    }),

  /**
   * 提现
   * @param {string} number 提现数量
   */
  withdrawal: (params) => request.post("/api/user/withdrawal", params),

  /**
   *用户资产明细
   */
  assetsList: () => request.get("/api/krypton_gold/assets_list"),

  /**
   * 用户投资
   * @param {string} number 充币数量
   */
  deposite: ({ strategy_id, number }) =>
    request.post("/api/krypton_gold/deposite", { strategy_id, number }),

  /**
   *  用户撤回充币
   * @param {string} number 撤出充币的数量
   */
  withdrawCapital: ({ number }) =>
    request.post("/api/krypton_gold/withdrawCapital", { number }),
  //结算
  // jiesuan: ({ number }) =>
  //   request.post("/api/krypton_gold/settleCapital", { number }),

  /**
   * 个人资料
   */
  // userInfo: () => request.get('/api/krypton_gold/user_info'),

  /**
   * 团队资料
   */
  teamInformation: () => request.get("/api/krypton_gold/team_information"),

  /**
   * 充值
   * @param {string} number 充值数量
   */
  recharge: (money) => request.post("/api/user/recharge", { money }),

  /**
   * 充值回调
   * @param {string} order_no 订单号
   * @param {string} hash
   */
  paymentVoucher: (data) => request.post("/api/user/payment_callback", data),

  /**
   * 用户资产面板
   */
  capitalOverview: () => request.get("/api/krypton_gold/capitalOverview"),
  /**
   * 趋势图
   */
  config: () => request.get("/api/common/config"),
  /**
   * 切换网络信息
   */
  chains: () => request.get("/api/common/chain"),
  /**
   * 质押记录
   */
  strategy: () => request.get("/api/krypton_gold/user_strategy_list"),

  /**
   * 策略池
   */

  krypton: () => request.get("/api/krypton_gold/strategy_list"),

  //
  /**
   * 获取用户信息
   */
  userInfo: () => request.get("/api/common/userinfo"),
  /**
   * 获取首页配置
   */
  getConfig: () => request.get("/api/common/config"),
  /**
   * 获取首页NFT列表
   */
  getNFTlist: () => request.get("/api/goods/notime"),

  /**
   * 获取NFT档次信息
   */
  getCategory: () => request.get("/api/goods/category"),
  /**
   * 获取Nft详情
   */
  nftdetail: (id) => request.get(`/api/goods/detail?id=${id}`),
  //提交留言
  message: (message) => request.post("/api/user/send_message", { message }),
  /**
   * 获取用户资产信息
   */
  userAssets: () => request.get("/api/user/earning"),
  /**
   * 更新Nft喜欢数
   */
  updateLike: (id) => request.get(`/api/goods/addlike?id=${id}`),
  /**
   * 生成订单
   */
  createOrder: (params) => request.post(`/api/order/create`, params),
  //获取NFT列表数据
  getList: (data) => request.post("/api/goods/list", data),
  //获取订单列表
  getOrderListAPI: (data) => request.post("/api/order/list", data),
  //获取邀请好友图片
  getInviteImgAPI: () => request.get("/api/user/invite"),
  //获取邀请明细
  getInviteDetailAPI: () => request.get("/api/user/invite_analysis"),
  //切换语言
  getLanguageAPI: (lang) => request.post("/api/common/language", { lang }),
  // 获取用户余额变更明细
  getBalanceAPI: (pagesize, page, type) =>
    request.post("/api/user/balance_log", { pagesize, page, type }),
  /**
   * 获取用户消息
   */
  getMessageAPI: () => request.get("/api/user/messages"),
  /**
   * 计算体现手续费
   */
  getWithdrawalFee: (money) => request.get(`/api/user/calc_fee?money=${money}`),
  /**
   * 是否为新用户
   */
  isnewUser: (address) => request.post(`/api/common/check_user`, { address }),
  /**
   * 左上角信息提示
   */
  info: (data) => request.get(`api/user/new_message`, { data }),
  /**
   * 获取公告信息
   */
  notice: (data) => request.get(`/api/common/notice`, { data }),
  /*
    提交实名信息
  */
  authenticationApi: (data) =>
    request.post(`/api/authentication/createUserDocument`, data),
	
	updateUserDocument: (data) =>
	  request.post(`/api/authentication/updateUserDocument`, data),
  /*
    获取邮箱验证码
  */
  getEmailCodeApi: (data) =>
    request.post(`/api/authentication/getEmailCode`, data),
  /*
   绑定邮箱
  */
  bindEmailApi: (data) => request.post(`/api/authentication/bindEmail`, data),
  /*
   获取教学视频
  */
  getDemoVideoUrlApi: (data) =>
    request.post(`/api/authentication/getDemoVideoUrl`, data),
  /*
   获取银行卡充值订单列表
  */
  getRechargeOrderApi: (data) =>
    request.post(`/api/authentication/getRechargeOrder`, data),
  /*
   getWithdrawalOrder
  */
  getWithdrawalOrderApi: (data) =>
    request.post(`/api/authentication/getWithdrawalOrder`, data),

  /*
   银行卡充值下单
  */
  rechargeOrderApi: (data) =>
    request.post(`/api/authentication/rechargeOrder`, data),
  /*
   获取充值比例
  */
  getRateApi: (data) => request.post(`/api/authentication/getRate`, data),
  /*
   获取充值比例
  */
  receiptFormOrderApi: (data) =>
    request.post(`/api/authentication/receiptFormOrder`, data),
  /*
   银行卡提现
  */
  withdrawalOrderApi: (data) =>
    request.post(`/api/authentication/withdrawalOrder`, data),
  /*
   获取认证信息
  */
  getDocumentInfoApi: (data) =>
    request.post(`/api/authentication/getDocumentInfo`, data),
};

export default $apis;
